goto out;
}
}
+ else
+ {
+ g_strchomp (ret_sha256);
+ }
*sha256 = ret_sha256;
ret = TRUE;
return ret;
}
+static gboolean
+write_checksum_file (const char *path,
+ const char *sha256,
+ GError **error)
+{
+ gboolean ret = FALSE;
+ char *buf = NULL;
+
+ buf = g_strconcat (sha256, "\n", NULL);
+
+ if (!g_file_set_contents (path, buf, -1, error))
+ goto out;
+
+ ret = TRUE;
+ out:
+ g_free (buf);
+ return ret;
+}
+
gboolean
hacktree_repo_check (HacktreeRepo *self, GError **error)
{
commit, &ret_commit_checksum, error))
goto out;
+ if (!write_checksum_file (priv->head_ref_path, g_checksum_get_string (ret_commit_checksum), error))
+ goto out;
+
+ g_free (priv->current_head);
+ priv->current_head = g_strdup (g_checksum_get_string (ret_commit_checksum));
+
ret = TRUE;
out:
if (!ret)